#ifndef MPU6050_H
#define MPU6050_H

#include "inv_mpu.h"
#include "inv_mpu_dmp_motion_driver.h"
#include <math.h>
#include <stdint.h>
#include "port_config.h"

typedef struct
{
    short x; //for car
    short y;
    short z;
}T_AXis;

typedef struct
{
    float pitch; //for car
    float roll;
    float yaw; 
}T_Euler;

typedef struct
{
    T_AXis  gyro;
    T_AXis  accel;
    T_Euler euler;
}T_Mpu6050;

T_Mpu6050 *mpu6050(void);
void mpu6050_init(void);
void mpu6050_update(void);
void mpu6050_wait_ok(uint32_t x);
int mpu_i2c_write(unsigned char slave_addr, unsigned char reg_addr, unsigned char length, unsigned char const *data);
int mpu_i2c_read(unsigned char slave_addr, unsigned char reg_addr, unsigned char length, unsigned char *data);

void mpu6050_task_example(void* arg);
#endif //__MPU6050_H
